package testDemo.Test9;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.Socket;

public class Client {
    public static void main(String[] args) throws IOException {
        Socket s = new Socket("127.0.0.1", 10066);
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("a.txt"));
        BufferedOutputStream bos = new BufferedOutputStream(s.getOutputStream());
        byte[] bytes = new byte[1024];
        int line;
        while((line=bis.read(bytes))!=-1){
            bos.write(bytes,0,line);
            bos.flush();
        }
        s.close();
    }
}
